import { getAllRoom } from '@/api/api'
import { resolve } from 'path'
export default {
    namespaced: true,
    state : {
        rooms : undefined,  //房间原始数据
    },
    getters : {
       
    },
    mutations : {
        setRooms(state, data) {
            state.rooms = data
        },
    },
    actions : {
        async updateRooms({commit}) {
            return Promise.resolve( 
                getAllRoom().then(response => commit('setRooms', response.data))
                .catch(error => console.log("获取房间数据失败！"))
            )
        },
    }
}